package com.edu.zut.hb.software.server.controller;

import com.edu.zut.hb.software.server.service.CountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 统计控制器
 *
 * @author ifax
 * @date 08-17
 */
@Api(tags = "CountController")
@RestController
@RequestMapping("/count")
public class CountController {
    @Autowired
    CountService countService;

    @ApiOperation(value = "统计所有用户")
    @GetMapping("/all")
    public Map<String, Integer> getRoleCount() {
        return countService.countRole();
    }
}
